<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<script src="/xlive/script/xlv.js"></script>
</head>
<body >
        <div id="orderMain_main" xlvobject="xlv.obj.pane" 
        	xlvmethod="{
        		initial:function(){
        			this.$self('initial');
        			var gcnl=this.getDataModel('gae-channel');
        			gcnl.openChannel();
        		}
        	}"
        >
            <div>
            	<div xlvobject="xlv.obj.webObject" 
                 	  xlvprop="{name:'order', objectURL:'rst.order',methodName:'list'}"
                 	  xlvmethod="{
                 	  	returnDataManage:function(clone){
                 	  		var p_xml=this.xml_properties;
                 	  		 if(this.xml_responseMethodNames()=='list'){
								var return_orders=this.xml_selectSingleNode('list/return/orders',p_xml.responseXML.documentElement);
								var orders_node=this.xml_selectSingleNode('properties/orders');
								while(orders_node.firstChild)orders_node.removeChild(orders_node.firstChild);
								while(return_orders.firstChild)orders_node.appendChild(this.xml_adoptNode(return_orders.firstChild));
								xlv.util.xmlExtendAttributes(orders_node,return_orders,'overwrite',true);
							}else if(this.xml_responseMethodNames()=='get-goods'){
								var return_goods=this.xml_selectSingleNode('get-goods/return/order/goods-list',p_xml.responseXML.documentElement);
								var order_key=this.getValue('get-goods/key');
								var goods_node=this.xml_selectSingleNode('properties/orders/order[key=\''+order_key+'\']/goods-list');
								while(goods_node.firstChild) goods_node.removeChild(goods_node.firstChild);
								while(return_goods.firstChild) goods_node.appendChild(this.xml_adoptNode(return_goods.firstChild));
								goods_node.setAttribute('xlv_got','true');
								xlv.util.xmlExtendAttributes(goods_node,return_goods,'overwrite',true);
							}else{
								this.$self('returnDataManage',clone);
							}
                 	  	},
                 	  	selectOrder:function(order){
                 	  		this.setValue(xlv.util.getXmlNodeValue('key',order),'get-goods.key');
                 	  		var got = xlv.util.getXmlNodeValue('goods-list/@xlv_got',order);
            				if(!got) this.webMethod('get-goods');
            				return (got)?true:false;
                 	  	},
                 	  	updateOrder:function(key){
                 	  		var cs=this.xml_selectNodes('properties/orders/order[key=\''+key+'\']/child::*');
                 	  		var set_order=this.xml_selectSingleNode('properties/set-order');
							while(set_order.firstChild) set_order.removeChild(set_order.firstChild);
							for(var i=0;i &lt; cs.length;++i){
								if(cs[i].nodeName != 'goods-list') set_order.appendChild(cs[i].cloneNode(true));
							}
							this.webMethod('set-order');
                 	  	}
                 	  }"
                ></div>
                
                 <div xlvobject="xlv.obj.webObject" 
                 	  xlvprop="{name:'status', objectURL:'rst.status',methodName:'list'}"
                 	  xlvmethod="{
                 	  	getStatus:function(){
                 	  		var status='';
                 	  		var sts = this.getNode('list.return.data.pxml.status');
                 	  		var ns=this.xml_selectNodes('child::i',sts);
                 	  		for(var i=0;i &lt; ns.length;++i){
                 	  			status+=((status=='')?'':',')+ns[i].getAttribute('name');
                 	  		}
                 	  		return status;
                 	  	},
                 	  	getState:function(name){
                 	  		var state=this.xml_selectSingleNode('properties/list/return/data/pxml/status/i[@name=\''+name+'\']');
                 	  		return (state)?state.cloneNode(true):null;
                 	  	}
                 	  }"
                 >
                 </div>
                
                <!-- 
                 <div xlvobject="xlv.obj.tree" xlvprop="{dmName:'order'}"
                 ></div>
                -->
            </div>
            <div xlvobject="xlv.obj.ajaxPane" xlvprop="{paneIn:'top', paneURL:'/xlive/order.html'}">
            </div>
            <div style="clear:both;"></div>
        </div>
</body>
</html>
